/**
 *******************************************************************************
 * @author      Ashwin Vijayakumar
 * 
 * @file        MorseCode.h
 * 
 * @date        Sep 9, 2012 11:50:03 AM
 *******************************************************************************
 * @copyright 2012
 * <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/>Creative Commons by-nc-sa</a>
 * by <a href="http://www.afflatustech.com">Afflatus Techtronics</a>
 * and <a href="http://www.ashwinvijayakumar.co.nr">Ashwin Vijayakumar</a>
 *******************************************************************************
 */

#ifndef include_guard_symbol
#define include_guard_symbol

/**@cond -----------------------------------------------------------------------
 * Includes section
 * ----------------------------------------------------------------- @endcond */

/**@cond System headers -------------------------------------------- @endcond */

/**@cond Local headers --------------------------------------------- @endcond */


/**@cond -----------------------------------------------------------------------
 * Constants section (Project scope)
 * ----------------------------------------------------------------- @endcond */

#define MORSE_CODE_PIN          GPIObits.GP5

#define MORSE_UNIT_DELAY        5000
#define MORSE_DOT_DELAY         MORSE_UNIT_DELAY
#define MORSE_DASH_DELAY        MORSE_UNIT_DELAY * 3
#define MORSE_ELEMENT_DELAY     MORSE_DOT_DELAY
#define MORSE_LETTER_DELAY      MORSE_DOT_DELAY * 3
#define MORSE_WORD_DELAY        MORSE_DOT_DELAY * 7

/**@cond -----------------------------------------------------------------------
 * Global variables section (Project scope)
 * ----------------------------------------------------------------- @endcond */

extern const int MorseCode_Map[37];

/**@cond -----------------------------------------------------------------------
 * Function prototypes section (Project scope)
 * ----------------------------------------------------------------- @endcond */

static void MorseCode_Dot( void );

static void MorseCode_Dash( void );

void MorseCode_Putc( char character );

void MorseCode_Puts( char* pChar );

static void MorseCode_Delay( int delay_counter );

#endif /* include_guard_symbol */


/** END OF FILE ********************* Copyright (C) 2012 Afflatus Techtronics */
